//
//  LaunchOption.swift
//  Source
//
//  Created by Toj on 2/23/23.
//

iOS 程序启动时总会调用application:didFinishLaunchingWithOptions:
其中第二个参数launchOptions为NSDictionary类型的对象, 里面存储有此程序启动的原因.

launchOptions中的可能键值见UIApplication Class Reference的Launch Options Keys节.

1. 若用户直接启动: 则
lauchOptions内无数据

2. 若由其他应用程序通过-(openURL:)启动: 则
UIApplicationLaunchOptionsURLKey:
对应的对象为启动URL(NSURL)
UIApplicationLaunchOptionsSourceApplicationKey
对应启动的源应用程序的bundle ID(NSString)

3. 若通过点击本地上方横幅通知启动: 则
UIApplicationLaunchOptionsLocalNotificationKey
对应的是为启动应用程序的的本地通知对象(UILocalNotification)

4. 若由远程通知启动: 则
UIApplicationLaunchOptionsRemoteNotificationKey
对应的是启动应用程序的的远程通知信息userInfo(NSDictionary)

5. 其他key还有
@available(iOS, introduced: 4.0, deprecated: 10.0, message: "Use UserNotifications Framework's -[UNUserNotificationCenterDelegate didReceiveNotificationResponse:withCompletionHandler:]")
let localNotification
let url
let sourceApplication
let remoteNotification
let annotation
let location
let newsstandDownloads
let bluetoothCentrals
let bluetoothPeripherals
let shortcutItem
let eventAttribution
let userActivityDictionary
let userActivityType
let cloudKitShareMetadata
